package com.kkb.service.file.impl;

import com.kkb.bean.AnthologyTags;
import com.kkb.bean.FileAnthologyTable;
import com.kkb.dao.FileAnthologyTableMapper;
import com.kkb.service.file.FileAnthologyTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author 何世鹏
 * @Date 2021/4/12 10:52
 */
@Service
public class FileAnthologyTableServiceImpl implements FileAnthologyTableService {

    @Autowired
    private FileAnthologyTableMapper mapper;

    /**
     * 删除关联专用删除
     *
     * @param req         请求
     * @param resp        响应
     * @param anthologyId 文集ID
     */
    @Override
    public void del(HttpServletRequest req, HttpServletResponse resp, Integer anthologyId) {
        List<FileAnthologyTable> select = mapper.select(new FileAnthologyTable(anthologyId));
        for (FileAnthologyTable fileAnthologyTable : select) {
            mapper.delete(fileAnthologyTable);
        }
    }
}
